import { View } from "../../../mvc/core/View";
import { LayerManager } from "../../manager/LayerManager";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { BaseItem } from "../common/BaseItem";
import { ObjCreate } from "../common/ObjCreate";
import { Language } from "../../../../extend/language/Language";
import { GTextFormat } from "../../../common/GTextFormat";
import { ItemData } from "../../resource/info/ItemData";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
//class NoviceGiftSprite
    
    export  class NoviceGiftSprite extends View
    {
        constructor()
        {
            super();
            layer = LayerManager.uiLayer;
            this.init();
            buttonMode = true;
            useHandCursor = true;
            mouseChildren = false;
            addEventListener(flash.events.MouseEvent.CLICK, this.onMouseClickHandler);
            return;
        }

        /* internal  */init(): void
        {
            var loc1=GlobalClass.getBitmap(ImagesConst.PackItemBg);
            addChild(loc1);
            this._item = new BaseItem();
            this._item.setSize(33, 33);
            this._item.move(2, 2);
            this._item.isDragAble = false;
            this._item.isDropAble = false;
            addChild(this._item);
            var loc2=ObjCreate.createTextField(Language.getString(35840), -6, loc1.height + 5, 80, 20, this, new GTextFormat("", 12, 16776960));
            return;
        }

        public updateItem(arg1: ItemData): void
        {
            this._itemData = arg1;
            this._item.itemData = arg1;
            return;
        }

        /* internal  */onMouseClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.NoviceGiftItemListShow, this._itemData));
            return;
        }

        /* internal */ /* var */_item: BaseItem;

        /* internal */ /* var */_itemData: ItemData;
    }
